FROM openeuler/openjdk:23_13-oe2203sp3
ENV JMETER_VERSION 5.6.3
ENV JMETER_DOWNLOAD_URL https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
RUN mkdir -p ${JMETER_HOME} \
    && curl -SL ${JMETER_DOWNLOAD_URL} | tar -xz -C ${JMETER_HOME} --strip-components=1
ENV PATH ${JMETER_HOME}/bin:$PATH
RUN mkdir /app
WORKDIR /app
RUN yum install -y wget
RUN wget -P /app https://gitee.com/opensourceway/test-management/raw/master/jmeter/maoyan.jmx
RUN chmod +x /app/maoyan.jmx
RUN touch /app/maoyan.jtl
ENTRYPOINT ["jmeter", "-n","-t","/app/maoyan.jmx","-l","/app/maoyan.jtl"]

RUN wget -P /app https://gitee.com/opensourceway/test-management/raw/master/pythonlib/requirements.txt
RUN wget -P /app https://gitee.com/opensourceway/test-management/raw/master/pythonlib/j2e.py
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
RUN python3 get-pip.py
RUN pip3 install --no-cache-dir -r /app/requirements.txt
ENTRYPOINT ["python3", "/app/j2e.py"]
